using System;
using System.Collections.Generic;
using Main.GameTime;
using Main.Transition;
using ZSW.Framework;

namespace Main.Save
{
    [Serializable]
    public class DataSlot
    {
        /// <summary>
        /// 进度条,string是guid
        /// </summary>
        public Dictionary<string, GameSaveData> DataDict = new Dictionary<string, GameSaveData>();

        public string DateTime
        {
            get
            {
                var key = ZSWF_IOCContainer.Get<TimeManager>().GUID;

                if (DataDict.ContainsKey(key))
                {
                    var timeData = DataDict[key];
                    return $"{timeData.timeDict["Year"]}年{timeData.timeDict["Month"]}月{timeData.timeDict["Day"]}日 {timeData.timeDict["Hour"]}:{timeData.timeDict["Minute"]}分";
                }
                else
                {
                    return "新的开始";
                }
            }
        }

        public string SceneName
        {
            get
            {
                var key = ZSWF_IOCContainer.Get<SceneTransitionManager>().GUID;
                if (DataDict.ContainsKey(key))
                {
                    var TransitionData = DataDict[key];
                    return TransitionData.DataSceneName switch
                    {
                        "01_Field" => "农场",
                        "02_Home" => "小木屋",
                        "03_Stall" => "市场",
                        _ => string.Empty,
                    };
                }
                else
                {
                    return string.Empty;
                }
            }
        }
    }
}
